import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.Arrays;

public class 四平方和 {
    static int[] arr = new int[4];
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintStream out = new PrintStream(System.out);
        int n = Integer.parseInt(in.readLine());

        for (int i = 0; i*i<=n ; i++)
            for (int j = i; j*j+i*i <=n ; j++)
                for (int k = j; k*k+j*j+i*i <=n ; k++) {
                    int s = n- (k*k+j*j+i*i);
                    int m = (int)Math.sqrt(s);
                    if(n == m*m+i*i+j*j+k*k) {
                        System.out.println(i+" "+j+" "+k+" "+m);
                        return;
                    }
                }
    }
}
